package xyz.zq.sf.common.security.util;

import lombok.experimental.UtilityClass;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @author hzq
 * @date 2021-02-05 14:13
 */
@UtilityClass
public class SecurityUtil {

    /**
     * 获取认证信息
     *
     * @return 认证信息
     */
    public Authentication getAuthentication() {
        return SecurityContextHolder.getContext().getAuthentication();
    }
}
